﻿// <copyright file="ArcTestsSetup.cs" company="City of Portland, BES-ASM">
// </copyright>
// <summary>Class for setting up and tearing down all ArcTests</summary>

namespace BESASM.EMGAATS.Arc
{
  using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  using ESRI.ArcGIS.esriSystem;
  using NUnit.Framework;
  
  /// <summary>
  /// Class for setting up and tearing down all ArcTests
  /// </summary>
  [Category("Arc")]
  [SetUpFixture]
  public class ArcTestsSetup
  {
    private static LicenseInitializer arcLicenseInitializer = new LicenseInitializer();

    /// <summary>
    /// Sets up all ArcTests by checking out appropriate ArcGIS licenses.
    /// </summary>
    [SetUp]
    public void Setup()
    {
      arcLicenseInitializer.InitializeApplication(
        new esriLicenseProductCode[] { esriLicenseProductCode.esriLicenseProductCodeBasic },
        new esriLicenseExtensionCode[] { });
    }

    /// <summary>
    /// Tears down all ArcTests by releasing all licenses.
    /// </summary>
    [TearDown]
    public void TearDown()
    {
      arcLicenseInitializer.ShutdownApplication();
    }
  }
}
